
<div class="pages_btns">
	<div id="nav">
		<?=html::anchor('forum', '论坛首页')?> » <?=$category->title_cn?>
	</div>
	<div class="threadflow postbtn"><?=html::anchor('forum/newtopic/'.$category->id, '发新话题')?></div>
</div>
<div class="mainbox threadlist">
		<table cellspacing="0" cellpadding="0">
			<caption><?=$category->title_cn?></caption>
			<thead class="category">
				<tr>
					<td class="folder">&nbsp;</td>
					<td class="icon">&nbsp;</td>
					<th>标题</th>
					<td class="author">作者</td>
					<td class="nums">回复/查看</td>
					<td class="lastpost">最后发表</td>
				</tr>
			</thead><tbody>
			<?php if(count($topics) > 0 ) { foreach($topics as $topic) { ?>
			<tr>
				<td class="folder"><?=html::image('images/forum/folder_common.gif')?></td>
				<td class="icon">&nbsp;</td>
				<th class="common">
					<label>&nbsp;</label>
					<span id="thread_1"><?=html::anchor('forum/topic/'.$category->id.'/'.$topic->id.'/1', $topic->subject)?></span>
				</th>
				<td class="author">
					<cite><?=$topic->author?></cite>
					<em><?=substr($topic->updated_at, 0, 10)?></em>
				</td>
				<td class="nums"><strong><?=$topic->replies?></strong> / <em><?=$topic->views?></em></td>
				<td class="lastpost">
					<em><?=substr($topic->last_post_at, 0, 16)?></em>
					<cite>by <?=$topic->last_poster?></cite>
				</td>
			</tr>
			<?php } } else { ?>
			<tr><td colspan="6">本版块或指定的范围内尚无主题。</td></tr>
			<?php } ?>
			</tbody>
</table>

</div>
<div class="pages_btns" style="margin-top:-10px;">
	<?=$this->pagination?>
	<div class="threadflow postbtn"><?=html::anchor('forum/newtopic/'.$category->id, '发新话题')?></div>
</div>

<?php if( cookie::get('username') != '' ) { ?>
<form method="post" action="/forum/savenewtopic/<?=$category->id?>" onsubmit="return Validator.Validate(this,2)">
<div class="box" id="quickpost">
	<h4>快速发新话题</h4>
	<table><tr>
		<td width="100"><label for="subject">标题</label></td>
		<td><input type="text" tabindex="1" size="120" name="subject" id="subject" dataType="Require" msg="请输入主题标题"/></td>
	</tr><tr>
		<td valign="top"><label>内容</label></td>
		<td><textarea tabindex="2" id="message" name="message" class="autosave" cols="150" rows="7" dataType="Require" msg="请输入主题内容"></textarea></td>
	</tr><tr>
		<td> </td>
		<td><input tabindex="3" id="postsubmit" name="topicsubmit" type="submit" value="发表帖子"/></td>
	</tr></table>
</div></form>
<?php } ?>